/*
 * @作者: Fultom
 * @创建时间: 2024-08-13 16:00:02
 * @最近修改时间: 2025-07-14 13:50:01
 * @功能:
 */
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  build: {
    // 开发阶段启用源码映射：https://uniapp.dcloud.net.cn/tutorial/migration-to-vue3.html#需主动开启-sourcemap
    sourcemap: process.env.NODE_ENV === 'development',
  },

  plugins: [uni()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },
  css: {
    preprocessorOptions: {
      sass: {
        sassOptions: {
          quietDeps: true,
        },
      },
      scss: {
        additionalData: `@import '@/uni.scss';`,
      },
    },
  },
})
